

#ifndef UC_GENURBSF_H
#define UC_GENURBSF_H

#include "zgegbl.h"
#include "zgesurf.h"
#include "zgept3dar.h"
#include "zgedblar.h"
#pragma pack (push, 8)

class UcGeKnotVector;
class UcGeNurbCurve3d;

class
GX_DLLEXPIMPORT
UcGeNurbSurface : public UcGeSurface
{
public:
   UcGeNurbSurface();
   UcGeNurbSurface(int degreeU, int degreeV, int propsInU, int propsInV,
                   int numControlPointsInU, int numControlPointsInV,
                   const UcGePoint3d controlPoints[],
                   const double weights[],
                   const UcGeKnotVector& uKnots,
                   const UcGeKnotVector& vKnots,
                   const UcGeTol& tol = UcGeContext::gTol);
   UcGeNurbSurface(const UcGeNurbSurface& nurb);

   UcGeNurbSurface& operator = (const UcGeNurbSurface& nurb);

   ZSoft::Boolean   isRationalInU      () const;
   ZSoft::Boolean   isPeriodicInU      (double&) const;
   ZSoft::Boolean   isRationalInV      () const;
   ZSoft::Boolean   isPeriodicInV      (double&) const;

   int singularityInU () const;
   int singularityInV () const;

   int            degreeInU            () const;

   int            numControlPointsInU  () const;

   int            degreeInV            () const;

   int            numControlPointsInV  () const;

   void           getControlPoints     (UcGePoint3dArray& points) const;

   ZSoft::Boolean getWeights           (UcGeDoubleArray& weights) const;

   int       numKnotsInU    () const;
   void      getUKnots      (UcGeKnotVector& uKnots) const;

   int       numKnotsInV    () const;
   void      getVKnots      (UcGeKnotVector& vKnots) const;

   void      getDefinition  (int& degreeU, int& degreeV,
                             int& propsInU,	int& propsInV,
                             int& numControlPointsInU,
                             int& numControlPointsInV,
                             UcGePoint3dArray& controlPoints,
                             UcGeDoubleArray& weights,
                             UcGeKnotVector& uKnots,
                             UcGeKnotVector& vKnots) const;

   UcGeNurbSurface& set     (int degreeU, int degreeV,
                             int propsInU, int propsInV,
                             int numControlPointsInU,
                             int numControlPointsInV,
                             const UcGePoint3d controlPoints[],
                             const double weights[],
                             const UcGeKnotVector& uKnots,
                             const UcGeKnotVector& vKnots,
                             const UcGeTol& tol = UcGeContext::gTol);

   void           setsingularityInU(int);	// INTERNAL USE ONLY
   void           setsingularityInV(int);	// INTERNAL USE ONLY

   void           setdegreeInU(int);		// INTERNAL USE ONLY
   void           setdegreeInV(int);		// INTERNAL USE ONLY
   void           setnumControlPointsInU(int);	// INTERNAL USE ONLY
   void           setnumControlPointsInV(int);	// INTERNAL USE ONLY

   void			  setControlPoints     (UcGePoint3dArray& points);	// INTERNAL USE ONLY
   void           setWeights           (UcGeDoubleArray& weights);	// INTERNAL USE ONLY
   void			  setUknots      (UcGeKnotVector& uKnots);			// INTERNAL USE ONLY
   void           setVknots      (UcGeKnotVector& vKnots);			// INTERNAL USE ONLY

   void computeVIsoLine(double V, UcGeNurbCurve3d& isoline) const;	// INTERNAL USE ONLY
   void computeUIsoLine(double U, UcGeNurbCurve3d& isoline) const;	// INTERNAL USE ONLY


   int loc(int i, int j) const;		// INTERNAL USE ONLY
protected:
   void calculateNURBSProperties();	// INTERNAL USE ONLY

};

#pragma pack (pop)
#endif
